import { Allow, IsNotEmpty, IsNumber, IsOptional, MaxLength } from 'class-validator'
import i18n, { i18nMessage } from '@/i18n'
import { ApiProperty } from '@nestjs/swagger'

export class MetaResourceChartExampleSaveDto {
  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-example-save.12151151-0') })
  @MaxLength(64, { message: i18nMessage() })
  @IsNotEmpty()
  label: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-example-save.12151151-1') })
  @IsNotEmpty()
  content: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-example-save.12151151-2') })
  @IsNotEmpty()
  @MaxLength(64, { message: i18nMessage() })
  groupLabel: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-example-save.12151151-3') })
  @Allow()
  thumbnail?: string

  @ApiProperty({ description: i18n.t('app-meta.dto.meta-resource-chart-example-save.12151151-4') })
  @IsNumber()
  @IsOptional()
  sortNo?: number
}
